//
//  MessageViewController.m
//  TheRoadAD
//
//  Created by baixue on 16/8/16.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "MessageViewController.h"
#import "MessageCell.h"
#import "MessageDetailsView.h"//消息详情
static NSString *const MESSAGE = @"message";
@interface MessageViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;

@end

@implementation MessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"消息";
    [self createTableView];
}

-(void)createTableView{
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
    _tableView.showsVerticalScrollIndicator = NO;
    _tableView.bounces = NO;
    //注册
    [self.tableView registerNib:[UINib nibWithNibName:@"MessageCell" bundle:nil] forCellReuseIdentifier:MESSAGE];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:MESSAGE];
    //设置右箭头
    cell.accessoryType = 1;
//    cell.content.font = [UIFont fontWithName:@"qingyuan" size:12.0f];
    
    return cell;
}


-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100 * Screen_Height/736;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    MessageDetailsView *details = [[MessageDetailsView alloc] init];
    [self.navigationController pushViewController:details animated:YES];
}

//获取用户消息
-(void)GetUserMessag{
    //URL：http://114.215.172.41:7756/Message/GetUserMessage
    NSDictionary *para = @{
                           
                           };
    
}

@end
